<?php

define('YANGJIFANG',true);

require_once "db.php";
$db = new Db();

$id = intval($_GET['id']);
if(!$id){
   $id = 1;
}

$sql = 'select * from posts where id = '.$id;
$article = $db->getOne($sql);

?>

<html>
    <head>
        <title><?php echo $article['title'];?></title>
        <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    </head>
    <body>
        <h1><?php echo $article['title'];?></h1>
        <div><?php echo date('Y-m-d',$article['add_time']);?></div>
        <p>
            <?php echo $article['content'];?>
        </p>
    </body>
</html>

